// 
// Decompiled by Procyon v0.5.36
// 

package com.orange.boot.utils;

import org.springframework.context.annotation.Bean;
import org.springframework.http.converter.HttpMessageConverter;
import java.util.List;
import java.nio.charset.StandardCharsets;
import org.springframework.http.converter.StringHttpMessageConverter;
import org.springframework.web.client.RestTemplate;
import org.springframework.context.annotation.Configuration;

@Configuration
public class BeanConfig {
    public BeanConfig() {
    }

    @Bean
    public RestTemplate restTemplate() {
        RestTemplate restTemplate = new RestTemplate();
        List<HttpMessageConverter<?>> httpMessageConverters = restTemplate.getMessageConverters();
        httpMessageConverters.stream().forEach((httpMessageConverter) -> {
            if (httpMessageConverter instanceof StringHttpMessageConverter) {
                StringHttpMessageConverter messageConverter = (StringHttpMessageConverter)httpMessageConverter;
                messageConverter.setDefaultCharset(StandardCharsets.UTF_8);
            }

        });
        return restTemplate;
    }
}